<?php

class ActionIndex extends BaseAction
{
    public function run()
    {
        $oCriteria            = new CDbCriteria();
        $oCriteria->join      = 'INNER JOIN auth_assignment ON (auth_assignment.userid = user_id AND auth_assignment.itemname = "user_sole_proprietorship")';
        $oCriteria->condition = 'status IN ("active", "inactive")';

        $this->template->iPendingUsersCnt = User::model()->countByAttributes(array('status' => 'pending'));
        $this->template->iApprovedUsersCnt = User::model()->countByAttributes(array('status' => array('active', 'inactive')));
        $this->template->iMetalsUsersCnt = User::model()->count($oCriteria);
        $this->template->iRejectedUsersCnt = User::model()->countByAttributes(array('status' => 'rejected'));
    }
}